package o;

import android.text.TextUtils;
import com.huawei.appgallery.festivalanimation.particle.modifiers.SizeModifier;
import com.huawei.appgallery.foundation.ui.framework.cardkit.bean.CardBean;
import com.huawei.appmarket.service.store.awk.bean.VideoStreamListCardBean;
import java.util.ArrayList;
import java.util.List;

public final class emt {
    private static int ˋ = -100;

    public static boolean ॱ() {
        if (ˋ == 1) {
            return true;
        }
        ˋ = eua.ˏ().ॱ("is_guide_showed", -1);
        if (ˋ != 1) {
            return false;
        }
        return true;
    }

    public static void ˏ(boolean z) {
        if (z) {
            eua.ˏ().ˊ("is_guide_showed", 1);
        }
    }

    public static List<VideoStreamListCardBean> ॱ(List<CardBean> list) {
        List<VideoStreamListCardBean> arrayList = new ArrayList();
        for (CardBean cardBean : list) {
            if (cardBean instanceof VideoStreamListCardBean) {
                arrayList.add((VideoStreamListCardBean) cardBean);
            }
        }
        return arrayList;
    }

    public static float ˊ(String str) {
        if (TextUtils.isEmpty(str) || !str.contains("x")) {
            return SizeModifier.STABLE_STATE_SCALE;
        }
        int indexOf = str.indexOf("x");
        if (indexOf <= 0 || str.length() <= indexOf + 1) {
            return SizeModifier.STABLE_STATE_SCALE;
        }
        try {
            int parseInt = Integer.parseInt(str.substring(0, indexOf).trim());
            indexOf = Integer.parseInt(str.substring(indexOf + 1, str.length()).trim());
            if (parseInt > 0) {
                return ((float) indexOf) / ((float) parseInt);
            }
            return SizeModifier.STABLE_STATE_SCALE;
        } catch (NumberFormatException e) {
            Logger.e("VideoStreamUtil", e.toString());
            return SizeModifier.STABLE_STATE_SCALE;
        }
    }
}
